home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 60 / IOPROG_60.ISO / soft / c++ / gsl-1.1.1-setup.exe / {app} / src / statistics / test.c < prev    next >
Encoding:
C/C++ Source or Header  |  2001-08-22  |  3.0 KB  |  128 lines

  1. /* statistics/test.c
  2.  * 
  3.  * Copyright (C) 1996, 1997, 1998, 1999, 2000 Jim Davies, Brian Gough
  4.  * 
  5.  * This program is free software; you can redistribute it and/or modify
  6.  * it under the terms of the GNU General Public License as published by
  7.  * the Free Software Foundation; either version 2 of the License, or (at
  8.  * your option) any later version.
  9.  * 
  10.  * This program is distributed in the hope that it will be useful, but
  11.  * WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.  * General Public License for more details.
  14.  * 
  15.  * You should have received a copy of the GNU General Public License
  16.  * along with this program; if not, write to the Free Software
  17.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  */
  19.  
  20. #include <config.h>
  21. #include <string.h>
  22. #include <stdlib.h>
  23. #include <math.h>
  24.  
  25. #include <gsl/gsl_test.h>
  26. #include <gsl/gsl_sort.h>
  27. #include <gsl/gsl_sort_vector.h>
  28. #include <gsl/gsl_statistics.h>
  29. #include <gsl/gsl_ieee_utils.h>
  30.  
  31. /* Test program for mean.c.  JimDavies 7.96 */
  32.  
  33. #define BASE_LONG_DOUBLE
  34. #include "templates_on.h"
  35. #include "test_float_source.c"
  36. #include "templates_off.h"
  37. #undef  BASE_LONG_DOUBLE
  38.  
  39. #define BASE_DOUBLE
  40. #include "templates_on.h"
  41. #include "test_float_source.c"
  42. #include "templates_off.h"
  43. #undef  BASE_DOUBLE
  44.  
  45. #define BASE_FLOAT
  46. #include "templates_on.h"
  47. #include "test_float_source.c"
  48. #include "templates_off.h"
  49. #undef  BASE_FLOAT
  50.  
  51. #define BASE_ULONG
  52. #include "templates_on.h"
  53. #include "test_int_source.c"
  54. #include "templates_off.h"
  55. #undef  BASE_ULONG
  56.  
  57. #define BASE_LONG
  58. #include "templates_on.h"
  59. #include "test_int_source.c"
  60. #include "templates_off.h"
  61. #undef  BASE_LONG
  62.  
  63. #define BASE_UINT
  64. #include "templates_on.h"
  65. #include "test_int_source.c"
  66. #include "templates_off.h"
  67. #undef  BASE_UINT
  68.  
  69. #define BASE_INT
  70. #include "templates_on.h"
  71. #include "test_int_source.c"
  72. #include "templates_off.h"
  73. #undef  BASE_INT
  74.  
  75. #define BASE_USHORT
  76. #include "templates_on.h"
  77. #include "test_int_source.c"
  78. #include "templates_off.h"
  79. #undef  BASE_USHORT
  80.  
  81. #define BASE_SHORT
  82. #include "templates_on.h"
  83. #include "test_int_source.c"
  84. #include "templates_off.h"
  85. #undef  BASE_SHORT
  86.  
  87. #define BASE_UCHAR
  88. #include "templates_on.h"
  89. #include "test_int_source.c"
  90. #include "templates_off.h"
  91. #undef  BASE_UCHAR
  92.  
  93. #define BASE_CHAR
  94. #include "templates_on.h"
  95. #include "test_int_source.c"
  96. #include "templates_off.h"
  97. #undef  BASE_CHAR
  98.  
  99.  
  100. int
  101. main (void)
  102. {
  103.   size_t s1, s2;
  104.  
  105.   gsl_ieee_env_setup ();
  106.  
  107.   for (s1 = 1; s1 < 4 ; s1++) 
  108.     {
  109.       s2 = (s1 < 3) ? 1 : (s1 - 1) ;
  110.  
  111.       test_func (s1,s2);
  112.       test_float_func (s1,s2);
  113.       test_long_double_func (s1,s2);
  114.       
  115.       test_ulong_func (s1,s2);
  116.       test_long_func (s1,s2);
  117.       test_uint_func (s1,s2);
  118.       test_int_func (s1,s2);
  119.       test_ushort_func (s1,s2);
  120.       test_short_func (s1,s2);
  121.       test_uchar_func (s1,s2);
  122.       test_char_func (s1,s2);
  123.     }
  124.  
  125.   exit (gsl_test_summary ());
  126. }
  127.  
  128.